// BitmapPicture.cpp: implementation of the BitmapPicture class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "BitmapPicture.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

BitmapPicture::BitmapPicture()
{
	m_handle = NULL;
}

BitmapPicture::~BitmapPicture()
{
	if(m_handle != NULL)
	{
		DeleteObject(m_handle);
	}
}

CString BitmapPicture::SetBitmap(const CString& strBitmap)
{
	if(m_strBitmap == strBitmap)
		return m_strBitmap;

	CString strTemp = m_strBitmap;
	m_strBitmap = strBitmap;

	HANDLE handle;
	m_handle = ::LoadImage(NULL, m_strBitmap, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
	
	handle = CStatic::SetBitmap((HBITMAP)m_handle);
	if(handle != NULL)
	{
		::DeleteObject(handle);
	}
	return strTemp;
}

void BitmapPicture::ShowBitmap(CBitmap& bitmap)
{
}